#include "dwgpointitem.h"
#include <QPainter>
#include <QDebug>
#include <QGraphicsSceneMouseEvent>

DwgPointItem::DwgPointItem()
{
    setFlag(QGraphicsItem::ItemIsFocusable);
}

QRectF DwgPointItem::boundingRect() const
{
    return QRectF(-3,-3,6,6);
}

void DwgPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    QPen pen(mColor);
    painter->setPen(pen);
    painter->drawEllipse(-3,-3,6,6);
}

bool DwgPointItem::Select()
{
    mSelected = true;
    return true;
}


void DwgPointItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
    //qDebug() << "3、Item Mouse Pos " << event->pos();
    QGraphicsItem::mousePressEvent(event);
}
